home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JTree.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  28.5 KB  |  1,729 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Dimension;
  5. import java.awt.GraphicsEnvironment;
  6. import java.awt.HeadlessException;
  7. import java.awt.LayoutManager;
  8. import java.awt.Point;
  9. import java.awt.Rectangle;
  10. import java.awt.event.MouseEvent;
  11. import java.io.IOException;
  12. import java.io.ObjectInputStream;
  13. import java.io.ObjectOutputStream;
  14. import java.io.Serializable;
  15. import java.util.Collections;
  16. import java.util.Enumeration;
  17. import java.util.Hashtable;
  18. import java.util.Set;
  19. import java.util.Stack;
  20. import java.util.Vector;
  21. import javax.accessibility.Accessible;
  22. import javax.accessibility.AccessibleContext;
  23. import javax.accessibility.AccessibleState;
  24. import javax.swing.JTree.1;
  25. import javax.swing.event.TreeExpansionEvent;
  26. import javax.swing.event.TreeExpansionListener;
  27. import javax.swing.event.TreeModelEvent;
  28. import javax.swing.event.TreeModelListener;
  29. import javax.swing.event.TreeSelectionEvent;
  30. import javax.swing.event.TreeSelectionListener;
  31. import javax.swing.event.TreeWillExpandListener;
  32. import javax.swing.plaf.TreeUI;
  33. import javax.swing.plaf.UIResource;
  34. import javax.swing.text.Position;
  35. import javax.swing.text.Position.Bias;
  36. import javax.swing.tree.DefaultMutableTreeNode;
  37. import javax.swing.tree.DefaultTreeModel;
  38. import javax.swing.tree.DefaultTreeSelectionModel;
  39. import javax.swing.tree.ExpandVetoException;
  40. import javax.swing.tree.TreeCellEditor;
  41. import javax.swing.tree.TreeCellRenderer;
  42. import javax.swing.tree.TreeModel;
  43. import javax.swing.tree.TreeNode;
  44. import javax.swing.tree.TreePath;
  45. import javax.swing.tree.TreeSelectionModel;
  46. import sun.swing.SwingUtilities2;
  47. import sun.swing.SwingUtilities2.Section;
  48.  
  49. public class JTree extends JComponent implements Scrollable, Accessible {
  50.    private static final String uiClassID = "TreeUI";
  51.    protected transient TreeModel treeModel;
  52.    protected transient TreeSelectionModel selectionModel;
  53.    protected boolean rootVisible;
  54.    protected transient TreeCellRenderer cellRenderer;
  55.    protected int rowHeight;
  56.    private boolean rowHeightSet;
  57.    private transient Hashtable expandedState;
  58.    protected boolean showsRootHandles;
  59.    private boolean showsRootHandlesSet;
  60.    protected transient TreeSelectionRedirector selectionRedirector;
  61.    protected transient TreeCellEditor cellEditor;
  62.    protected boolean editable;
  63.    protected boolean largeModel;
  64.    protected int visibleRowCount;
  65.    protected boolean invokesStopCellEditing;
  66.    protected boolean scrollsOnExpand;
  67.    private boolean scrollsOnExpandSet;
  68.    protected int toggleClickCount;
  69.    protected transient TreeModelListener treeModelListener;
  70.    private transient Stack expandedStack;
  71.    private TreePath leadPath;
  72.    private TreePath anchorPath;
  73.    private boolean expandsSelectedPaths;
  74.    private boolean settingUI;
  75.    private boolean dragEnabled;
  76.    private DropMode dropMode;
  77.    private transient DropLocation dropLocation;
  78.    private int expandRow;
  79.    private TreeTimer dropTimer;
  80.    private transient TreeExpansionListener uiTreeExpansionListener;
  81.    private static int TEMP_STACK_SIZE = 11;
  82.    public static final String CELL_RENDERER_PROPERTY = "cellRenderer";
  83.    public static final String TREE_MODEL_PROPERTY = "model";
  84.    public static final String ROOT_VISIBLE_PROPERTY = "rootVisible";
  85.    public static final String SHOWS_ROOT_HANDLES_PROPERTY = "showsRootHandles";
  86.    public static final String ROW_HEIGHT_PROPERTY = "rowHeight";
  87.    public static final String CELL_EDITOR_PROPERTY = "cellEditor";
  88.    public static final String EDITABLE_PROPERTY = "editable";
  89.    public static final String LARGE_MODEL_PROPERTY = "largeModel";
  90.    public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
  91.    public static final String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount";
  92.    public static final String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing";
  93.    public static final String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand";
  94.    public static final String TOGGLE_CLICK_COUNT_PROPERTY = "toggleClickCount";
  95.    public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath";
  96.    public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath";
  97.    public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths";
  98.  
  99.    protected static TreeModel getDefaultTreeModel() {
  100.       DefaultMutableTreeNode var0 = new DefaultMutableTreeNode("JTree");
  101.       DefaultMutableTreeNode var1 = new DefaultMutableTreeNode("colors");
  102.       var0.add(var1);
  103.       var1.add(new DefaultMutableTreeNode("blue"));
  104.       var1.add(new DefaultMutableTreeNode("violet"));
  105.       var1.add(new DefaultMutableTreeNode("red"));
  106.       var1.add(new DefaultMutableTreeNode("yellow"));
  107.       var1 = new DefaultMutableTreeNode("sports");
  108.       var0.add(var1);
  109.       var1.add(new DefaultMutableTreeNode("basketball"));
  110.       var1.add(new DefaultMutableTreeNode("soccer"));
  111.       var1.add(new DefaultMutableTreeNode("football"));
  112.       var1.add(new DefaultMutableTreeNode("hockey"));
  113.       var1 = new DefaultMutableTreeNode("food");
  114.       var0.add(var1);
  115.       var1.add(new DefaultMutableTreeNode("hot dogs"));
  116.       var1.add(new DefaultMutableTreeNode("pizza"));
  117.       var1.add(new DefaultMutableTreeNode("ravioli"));
  118.       var1.add(new DefaultMutableTreeNode("bananas"));
  119.       return new DefaultTreeModel(var0);
  120.    }
  121.  
  122.    protected static TreeModel createTreeModel(Object var0) {
  123.       Object var1;
  124.       if (!(var0 instanceof Object[]) && !(var0 instanceof Hashtable) && !(var0 instanceof Vector)) {
  125.          var1 = new DynamicUtilTreeNode("root", var0);
  126.       } else {
  127.          var1 = new DefaultMutableTreeNode("root");
  128.          javax.swing.JTree.DynamicUtilTreeNode.createChildren((DefaultMutableTreeNode)var1, var0);
  129.       }
  130.  
  131.       return new DefaultTreeModel((TreeNode)var1, false);
  132.    }
  133.  
  134.    public JTree() {
  135.       this(getDefaultTreeModel());
  136.    }
  137.  
  138.    public JTree(Object[] var1) {
  139.       this(createTreeModel(var1));
  140.       this.setRootVisible(false);
  141.       this.setShowsRootHandles(true);
  142.       this.expandRoot();
  143.    }
  144.  
  145.    public JTree(Vector<?> var1) {
  146.       this(createTreeModel(var1));
  147.       this.setRootVisible(false);
  148.       this.setShowsRootHandles(true);
  149.       this.expandRoot();
  150.    }
  151.  
  152.    public JTree(Hashtable<?, ?> var1) {
  153.       this(createTreeModel(var1));
  154.       this.setRootVisible(false);
  155.       this.setShowsRootHandles(true);
  156.       this.expandRoot();
  157.    }
  158.  
  159.    public JTree(TreeNode var1) {
  160.       this(var1, false);
  161.    }
  162.  
  163.    public JTree(TreeNode var1, boolean var2) {
  164.       this((TreeModel)(new DefaultTreeModel(var1, var2)));
  165.    }
  166.  
  167.    public JTree(TreeModel var1) {
  168.       this.rowHeightSet = false;
  169.       this.showsRootHandlesSet = false;
  170.       this.scrollsOnExpandSet = false;
  171.       this.dropMode = DropMode.USE_SELECTION;
  172.       this.expandRow = -1;
  173.       this.expandedStack = new Stack();
  174.       this.toggleClickCount = 2;
  175.       this.expandedState = new Hashtable();
  176.       this.setLayout((LayoutManager)null);
  177.       this.rowHeight = 16;
  178.       this.visibleRowCount = 20;
  179.       this.rootVisible = true;
  180.       this.selectionModel = new DefaultTreeSelectionModel();
  181.       this.cellRenderer = null;
  182.       this.scrollsOnExpand = true;
  183.       this.setOpaque(true);
  184.       this.expandsSelectedPaths = true;
  185.       this.updateUI();
  186.       this.setModel(var1);
  187.    }
  188.  
  189.    public TreeUI getUI() {
  190.       return (TreeUI)this.ui;
  191.    }
  192.  
  193.    public void setUI(TreeUI var1) {
  194.       if ((TreeUI)this.ui != var1) {
  195.          this.settingUI = true;
  196.          this.uiTreeExpansionListener = null;
  197.  
  198.          try {
  199.             super.setUI(var1);
  200.          } finally {
  201.             this.settingUI = false;
  202.          }
  203.       }
  204.  
  205.    }
  206.  
  207.    public void updateUI() {
  208.       this.setUI((TreeUI)UIManager.getUI(this));
  209.       TreeCellRenderer var1 = this.getCellRenderer();
  210.       if (!(var1 instanceof UIResource) && var1 instanceof Component) {
  211.          SwingUtilities.updateComponentTreeUI((Component)var1);
  212.       }
  213.  
  214.       TreeCellEditor var2 = this.getCellEditor();
  215.       if (!(var2 instanceof UIResource)) {
  216.          if (var2 instanceof Component) {
  217.             SwingUtilities.updateComponentTreeUI((Component)var2);
  218.          } else if (var2 instanceof DefaultCellEditor) {
  219.             Component var3 = ((DefaultCellEditor)var2).getComponent();
  220.             if (var3 != null) {
  221.                SwingUtilities.updateComponentTreeUI(var3);
  222.             }
  223.          }
  224.       }
  225.  
  226.    }
  227.  
  228.    public String getUIClassID() {
  229.       return "TreeUI";
  230.    }
  231.  
  232.    public TreeCellRenderer getCellRenderer() {
  233.       return this.cellRenderer;
  234.    }
  235.  
  236.    public void setCellRenderer(TreeCellRenderer var1) {
  237.       TreeCellRenderer var2 = this.cellRenderer;
  238.       this.cellRenderer = var1;
  239.       this.firePropertyChange("cellRenderer", var2, this.cellRenderer);
  240.       this.invalidate();
  241.    }
  242.  
  243.    public void setEditable(boolean var1) {
  244.       boolean var2 = this.editable;
  245.       this.editable = var1;
  246.       this.firePropertyChange("editable", var2, var1);
  247.       if (this.accessibleContext != null) {
  248.          this.accessibleContext.firePropertyChange("AccessibleState", var2 ? AccessibleState.EDITABLE : null, var1 ? AccessibleState.EDITABLE : null);
  249.       }
  250.  
  251.    }
  252.  
  253.    public boolean isEditable() {
  254.       return this.editable;
  255.    }
  256.  
  257.    public void setCellEditor(TreeCellEditor var1) {
  258.       TreeCellEditor var2 = this.cellEditor;
  259.       this.cellEditor = var1;
  260.       this.firePropertyChange("cellEditor", var2, var1);
  261.       this.invalidate();
  262.    }
  263.  
  264.    public TreeCellEditor getCellEditor() {
  265.       return this.cellEditor;
  266.    }
  267.  
  268.    public TreeModel getModel() {
  269.       return this.treeModel;
  270.    }
  271.  
  272.    public void setModel(TreeModel var1) {
  273.       this.clearSelection();
  274.       TreeModel var2 = this.treeModel;
  275.       if (this.treeModel != null && this.treeModelListener != null) {
  276.          this.treeModel.removeTreeModelListener(this.treeModelListener);
  277.       }
  278.  
  279.       if (this.accessibleContext != null) {
  280.          if (this.treeModel != null) {
  281.             this.treeModel.removeTreeModelListener((TreeModelListener)this.accessibleContext);
  282.          }
  283.  
  284.          if (var1 != null) {
  285.             var1.addTreeModelListener((TreeModelListener)this.accessibleContext);
  286.          }
  287.       }
  288.  
  289.       this.treeModel = var1;
  290.       this.clearToggledPaths();
  291.       if (this.treeModel != null) {
  292.          if (this.treeModelListener == null) {
  293.             this.treeModelListener = this.createTreeModelListener();
  294.          }
  295.  
  296.          if (this.treeModelListener != null) {
  297.             this.treeModel.addTreeModelListener(this.treeModelListener);
  298.          }
  299.  
  300.          if (this.treeModel.getRoot() != null && !this.treeModel.isLeaf(this.treeModel.getRoot())) {
  301.             this.expandedState.put(new TreePath(this.treeModel.getRoot()), Boolean.TRUE);
  302.          }
  303.       }
  304.  
  305.       this.firePropertyChange("model", var2, this.treeModel);
  306.       this.invalidate();
  307.    }
  308.  
  309.    public boolean isRootVisible() {
  310.       return this.rootVisible;
  311.    }
  312.  
  313.    public void setRootVisible(boolean var1) {
  314.       boolean var2 = this.rootVisible;
  315.       this.rootVisible = var1;
  316.       this.firePropertyChange("rootVisible", var2, this.rootVisible);
  317.       if (this.accessibleContext != null) {
  318.          ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  319.       }
  320.  
  321.    }
  322.  
  323.    public void setShowsRootHandles(boolean var1) {
  324.       boolean var2 = this.showsRootHandles;
  325.       TreeModel var3 = this.getModel();
  326.       this.showsRootHandles = var1;
  327.       this.showsRootHandlesSet = true;
  328.       this.firePropertyChange("showsRootHandles", var2, this.showsRootHandles);
  329.       if (this.accessibleContext != null) {
  330.          ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  331.       }
  332.  
  333.       this.invalidate();
  334.    }
  335.  
  336.    public boolean getShowsRootHandles() {
  337.       return this.showsRootHandles;
  338.    }
  339.  
  340.    public void setRowHeight(int var1) {
  341.       int var2 = this.rowHeight;
  342.       this.rowHeight = var1;
  343.       this.rowHeightSet = true;
  344.       this.firePropertyChange("rowHeight", var2, this.rowHeight);
  345.       this.invalidate();
  346.    }
  347.  
  348.    public int getRowHeight() {
  349.       return this.rowHeight;
  350.    }
  351.  
  352.    public boolean isFixedRowHeight() {
  353.       return this.rowHeight > 0;
  354.    }
  355.  
  356.    public void setLargeModel(boolean var1) {
  357.       boolean var2 = this.largeModel;
  358.       this.largeModel = var1;
  359.       this.firePropertyChange("largeModel", var2, var1);
  360.    }
  361.  
  362.    public boolean isLargeModel() {
  363.       return this.largeModel;
  364.    }
  365.  
  366.    public void setInvokesStopCellEditing(boolean var1) {
  367.       boolean var2 = this.invokesStopCellEditing;
  368.       this.invokesStopCellEditing = var1;
  369.       this.firePropertyChange("invokesStopCellEditing", var2, var1);
  370.    }
  371.  
  372.    public boolean getInvokesStopCellEditing() {
  373.       return this.invokesStopCellEditing;
  374.    }
  375.  
  376.    public void setScrollsOnExpand(boolean var1) {
  377.       boolean var2 = this.scrollsOnExpand;
  378.       this.scrollsOnExpand = var1;
  379.       this.scrollsOnExpandSet = true;
  380.       this.firePropertyChange("scrollsOnExpand", var2, var1);
  381.    }
  382.  
  383.    public boolean getScrollsOnExpand() {
  384.       return this.scrollsOnExpand;
  385.    }
  386.  
  387.    public void setToggleClickCount(int var1) {
  388.       int var2 = this.toggleClickCount;
  389.       this.toggleClickCount = var1;
  390.       this.firePropertyChange("toggleClickCount", var2, var1);
  391.    }
  392.  
  393.    public int getToggleClickCount() {
  394.       return this.toggleClickCount;
  395.    }
  396.  
  397.    public void setExpandsSelectedPaths(boolean var1) {
  398.       boolean var2 = this.expandsSelectedPaths;
  399.       this.expandsSelectedPaths = var1;
  400.       this.firePropertyChange("expandsSelectedPaths", var2, var1);
  401.    }
  402.  
  403.    public boolean getExpandsSelectedPaths() {
  404.       return this.expandsSelectedPaths;
  405.    }
  406.  
  407.    public void setDragEnabled(boolean var1) {
  408.       if (var1 && GraphicsEnvironment.isHeadless()) {
  409.          throw new HeadlessException();
  410.       } else {
  411.          this.dragEnabled = var1;
  412.       }
  413.    }
  414.  
  415.    public boolean getDragEnabled() {
  416.       return this.dragEnabled;
  417.    }
  418.  
  419.    public final void setDropMode(DropMode var1) {
  420.       if (var1 != null) {
  421.          switch (1.$SwitchMap$javax$swing$DropMode[var1.ordinal()]) {
  422.             case 1:
  423.             case 2:
  424.             case 3:
  425.             case 4:
  426.                this.dropMode = var1;
  427.                return;
  428.          }
  429.       }
  430.  
  431.       throw new IllegalArgumentException(var1 + ": Unsupported drop mode for tree");
  432.    }
  433.  
  434.    public final DropMode getDropMode() {
  435.       return this.dropMode;
  436.    }
  437.  
  438.    DropLocation dropLocationForPoint(Point var1) {
  439.       DropLocation var2 = null;
  440.       int var3 = this.getClosestRowForLocation(var1.x, var1.y);
  441.       Rectangle var4 = this.getRowBounds(var3);
  442.       TreeModel var5 = this.getModel();
  443.       Object var6 = var5 == null ? null : var5.getRoot();
  444.       TreePath var7 = var6 == null ? null : new TreePath(var6);
  445.       Object var8 = null;
  446.       Object var9 = null;
  447.       boolean var10 = var3 == -1 || var1.y < var4.y || var1.y >= var4.y + var4.height;
  448.       switch (1.$SwitchMap$javax$swing$DropMode[this.dropMode.ordinal()]) {
  449.          case 1:
  450.          case 2:
  451.             if (var10) {
  452.                var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
  453.             } else {
  454.                var2 = new DropLocation(var1, this.getPathForRow(var3), -1, (1)null);
  455.             }
  456.             break;
  457.          case 3:
  458.          case 4:
  459.             if (var3 == -1) {
  460.                if (var6 != null && !var5.isLeaf(var6) && this.isExpanded(var7)) {
  461.                   var2 = new DropLocation(var1, var7, 0, (1)null);
  462.                } else {
  463.                   var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
  464.                }
  465.             } else {
  466.                boolean var11 = this.dropMode == DropMode.ON_OR_INSERT || !var5.isLeaf(this.getPathForRow(var3).getLastPathComponent());
  467.                SwingUtilities2.Section var12 = SwingUtilities2.liesInVertical(var4, var1, var11);
  468.                TreePath var14;
  469.                TreePath var15;
  470.                if (var12 == Section.LEADING) {
  471.                   var14 = this.getPathForRow(var3);
  472.                   var15 = var14.getParentPath();
  473.                } else {
  474.                   if (var12 != Section.TRAILING) {
  475.                      assert var11;
  476.  
  477.                      var2 = new DropLocation(var1, this.getPathForRow(var3), -1, (1)null);
  478.                      break;
  479.                   }
  480.  
  481.                   int var13 = var3 + 1;
  482.                   if (var13 >= this.getRowCount()) {
  483.                      if (!var5.isLeaf(var6) && this.isExpanded(var7)) {
  484.                         var13 = var5.getChildCount(var6);
  485.                         var2 = new DropLocation(var1, var7, var13, (1)null);
  486.                      } else {
  487.                         var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
  488.                      }
  489.                      break;
  490.                   }
  491.  
  492.                   var14 = this.getPathForRow(var13);
  493.                   var15 = var14.getParentPath();
  494.                }
  495.  
  496.                if (var15 != null) {
  497.                   var2 = new DropLocation(var1, var15, var5.getIndexOfChild(var15.getLastPathComponent(), var14.getLastPathComponent()), (1)null);
  498.                } else if (!var11 && var5.isLeaf(var6)) {
  499.                   var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
  500.                } else {
  501.                   var2 = new DropLocation(var1, var7, -1, (1)null);
  502.                }
  503.             }
  504.             break;
  505.          default:
  506.             assert false : "Unexpected drop mode";
  507.       }
  508.  
  509.       if (var10 || var3 != this.expandRow) {
  510.          this.cancelDropTimer();
  511.       }
  512.  
  513.       if (!var10 && var3 != this.expandRow && this.isCollapsed(var3)) {
  514.          this.expandRow = var3;
  515.          this.startDropTimer();
  516.       }
  517.  
  518.       return var2;
  519.    }
  520.  
  521.    Object setDropLocation(TransferHandler.DropLocation var1, Object var2, boolean var3) {
  522.       Object var4 = null;
  523.       DropLocation var5 = (DropLocation)var1;
  524.       if (this.dropMode == DropMode.USE_SELECTION) {
  525.          if (var5 == null) {
  526.             if (!var3 && var2 != null) {
  527.                this.setSelectionPaths(((TreePath[][])((TreePath[][])var2))[0]);
  528.                this.setAnchorSelectionPath(((TreePath[][])((TreePath[][])var2))[1][0]);
  529.                this.setLeadSelectionPath(((TreePath[][])((TreePath[][])var2))[1][1]);
  530.             }
  531.          } else {
  532.             if (this.dropLocation == null) {
  533.                TreePath[] var6 = this.getSelectionPaths();
  534.                if (var6 == null) {
  535.                   var6 = new TreePath[0];
  536.                }
  537.  
  538.                var4 = new TreePath[][]{var6, {this.getAnchorSelectionPath(), this.getLeadSelectionPath()}};
  539.             } else {
  540.                var4 = var2;
  541.             }
  542.  
  543.             this.setSelectionPath(var5.getPath());
  544.          }
  545.       }
  546.  
  547.       DropLocation var7 = this.dropLocation;
  548.       this.dropLocation = var5;
  549.       this.firePropertyChange("dropLocation", var7, this.dropLocation);
  550.       return var4;
  551.    }
  552.  
  553.    void dndDone() {
  554.       this.cancelDropTimer();
  555.       this.dropTimer = null;
  556.    }
  557.  
  558.    public final DropLocation getDropLocation() {
  559.       return this.dropLocation;
  560.    }
  561.  
  562.    private void startDropTimer() {
  563.       if (this.dropTimer == null) {
  564.          this.dropTimer = new TreeTimer(this);
  565.       }
  566.  
  567.       this.dropTimer.start();
  568.    }
  569.  
  570.    private void cancelDropTimer() {
  571.       if (this.dropTimer != null && this.dropTimer.isRunning()) {
  572.          this.expandRow = -1;
  573.          this.dropTimer.stop();
  574.       }
  575.  
  576.    }
  577.  
  578.    public boolean isPathEditable(TreePath var1) {
  579.       return this.isEditable();
  580.    }
  581.  
  582.    public String getToolTipText(MouseEvent var1) {
  583.       String var2 = null;
  584.       if (var1 != null) {
  585.          Point var3 = var1.getPoint();
  586.          int var4 = this.getRowForLocation(var3.x, var3.y);
  587.          TreeCellRenderer var5 = this.getCellRenderer();
  588.          if (var4 != -1 && var5 != null) {
  589.             TreePath var6 = this.getPathForRow(var4);
  590.             Object var7 = var6.getLastPathComponent();
  591.             Component var8 = var5.getTreeCellRendererComponent(this, var7, this.isRowSelected(var4), this.isExpanded(var4), this.getModel().isLeaf(var7), var4, true);
  592.             if (var8 instanceof JComponent) {
  593.                Rectangle var10 = this.getPathBounds(var6);
  594.                var3.translate(-var10.x, -var10.y);
  595.                MouseEvent var9 = new MouseEvent(var8, var1.getID(), var1.getWhen(), var1.getModifiers(), var3.x, var3.y, var1.getXOnScreen(), var1.getYOnScreen(), var1.getClickCount(), var1.isPopupTrigger(), 0);
  596.                var2 = ((JComponent)var8).getToolTipText(var9);
  597.             }
  598.          }
  599.       }
  600.  
  601.       if (var2 == null) {
  602.          var2 = this.getToolTipText();
  603.       }
  604.  
  605.       return var2;
  606.    }
  607.  
  608.    public String convertValueToText(Object var1, boolean var2, boolean var3, boolean var4, int var5, boolean var6) {
  609.       if (var1 != null) {
  610.          String var7 = var1.toString();
  611.          if (var7 != null) {
  612.             return var7;
  613.          }
  614.       }
  615.  
  616.       return "";
  617.    }
  618.  
  619.    public int getRowCount() {
  620.       TreeUI var1 = this.getUI();
  621.       return var1 != null ? var1.getRowCount(this) : 0;
  622.    }
  623.  
  624.    public void setSelectionPath(TreePath var1) {
  625.       this.getSelectionModel().setSelectionPath(var1);
  626.    }
  627.  
  628.    public void setSelectionPaths(TreePath[] var1) {
  629.       this.getSelectionModel().setSelectionPaths(var1);
  630.    }
  631.  
  632.    public void setLeadSelectionPath(TreePath var1) {
  633.       TreePath var2 = this.leadPath;
  634.       this.leadPath = var1;
  635.       this.firePropertyChange("leadSelectionPath", var2, var1);
  636.    }
  637.  
  638.    public void setAnchorSelectionPath(TreePath var1) {
  639.       TreePath var2 = this.anchorPath;
  640.       this.anchorPath = var1;
  641.       this.firePropertyChange("anchorSelectionPath", var2, var1);
  642.    }
  643.  
  644.    public void setSelectionRow(int var1) {
  645.       int[] var2 = new int[]{var1};
  646.       this.setSelectionRows(var2);
  647.    }
  648.  
  649.    public void setSelectionRows(int[] var1) {
  650.       TreeUI var2 = this.getUI();
  651.       if (var2 != null && var1 != null) {
  652.          int var3 = var1.length;
  653.          TreePath[] var4 = new TreePath[var3];
  654.  
  655.          for(int var5 = 0; var5 < var3; ++var5) {
  656.             var4[var5] = var2.getPathForRow(this, var1[var5]);
  657.          }
  658.  
  659.          this.setSelectionPaths(var4);
  660.       }
  661.  
  662.    }
  663.  
  664.    public void addSelectionPath(TreePath var1) {
  665.       this.getSelectionModel().addSelectionPath(var1);
  666.    }
  667.  
  668.    public void addSelectionPaths(TreePath[] var1) {
  669.       this.getSelectionModel().addSelectionPaths(var1);
  670.    }
  671.  
  672.    public void addSelectionRow(int var1) {
  673.       int[] var2 = new int[]{var1};
  674.       this.addSelectionRows(var2);
  675.    }
  676.  
  677.    public void addSelectionRows(int[] var1) {
  678.       TreeUI var2 = this.getUI();
  679.       if (var2 != null && var1 != null) {
  680.          int var3 = var1.length;
  681.          TreePath[] var4 = new TreePath[var3];
  682.  
  683.          for(int var5 = 0; var5 < var3; ++var5) {
  684.             var4[var5] = var2.getPathForRow(this, var1[var5]);
  685.          }
  686.  
  687.          this.addSelectionPaths(var4);
  688.       }
  689.  
  690.    }
  691.  
  692.    public Object getLastSelectedPathComponent() {
  693.       TreePath var1 = this.getSelectionModel().getSelectionPath();
  694.       return var1 != null ? var1.getLastPathComponent() : null;
  695.    }
  696.  
  697.    public TreePath getLeadSelectionPath() {
  698.       return this.leadPath;
  699.    }
  700.  
  701.    public TreePath getAnchorSelectionPath() {
  702.       return this.anchorPath;
  703.    }
  704.  
  705.    public TreePath getSelectionPath() {
  706.       return this.getSelectionModel().getSelectionPath();
  707.    }
  708.  
  709.    public TreePath[] getSelectionPaths() {
  710.       return this.getSelectionModel().getSelectionPaths();
  711.    }
  712.  
  713.    public int[] getSelectionRows() {
  714.       return this.getSelectionModel().getSelectionRows();
  715.    }
  716.  
  717.    public int getSelectionCount() {
  718.       return this.selectionModel.getSelectionCount();
  719.    }
  720.  
  721.    public int getMinSelectionRow() {
  722.       return this.getSelectionModel().getMinSelectionRow();
  723.    }
  724.  
  725.    public int getMaxSelectionRow() {
  726.       return this.getSelectionModel().getMaxSelectionRow();
  727.    }
  728.  
  729.    public int getLeadSelectionRow() {
  730.       TreePath var1 = this.getLeadSelectionPath();
  731.       return var1 != null ? this.getRowForPath(var1) : -1;
  732.    }
  733.  
  734.    public boolean isPathSelected(TreePath var1) {
  735.       return this.getSelectionModel().isPathSelected(var1);
  736.    }
  737.  
  738.    public boolean isRowSelected(int var1) {
  739.       return this.getSelectionModel().isRowSelected(var1);
  740.    }
  741.  
  742.    public Enumeration<TreePath> getExpandedDescendants(TreePath var1) {
  743.       if (!this.isExpanded(var1)) {
  744.          return null;
  745.       } else {
  746.          Enumeration var2 = this.expandedState.keys();
  747.          Vector var3 = null;
  748.          if (var2 != null) {
  749.             while(var2.hasMoreElements()) {
  750.                TreePath var4 = (TreePath)var2.nextElement();
  751.                Object var5 = this.expandedState.get(var4);
  752.                if (var4 != var1 && var5 != null && (Boolean)var5 && var1.isDescendant(var4) && this.isVisible(var4)) {
  753.                   if (var3 == null) {
  754.                      var3 = new Vector();
  755.                   }
  756.  
  757.                   var3.addElement(var4);
  758.                }
  759.             }
  760.          }
  761.  
  762.          if (var3 == null) {
  763.             Set var6 = Collections.emptySet();
  764.             return Collections.enumeration(var6);
  765.          } else {
  766.             return var3.elements();
  767.          }
  768.       }
  769.    }
  770.  
  771.    public boolean hasBeenExpanded(TreePath var1) {
  772.       return var1 != null && this.expandedState.get(var1) != null;
  773.    }
  774.  
  775.    public boolean isExpanded(TreePath var1) {
  776.       if (var1 == null) {
  777.          return false;
  778.       } else {
  779.          Object var2 = this.expandedState.get(var1);
  780.          if (var2 != null && (Boolean)var2) {
  781.             TreePath var3 = var1.getParentPath();
  782.             return var3 != null ? this.isExpanded(var3) : true;
  783.          } else {
  784.             return false;
  785.          }
  786.       }
  787.    }
  788.  
  789.    public boolean isExpanded(int var1) {
  790.       TreeUI var2 = this.getUI();
  791.       if (var2 != null) {
  792.          TreePath var3 = var2.getPathForRow(this, var1);
  793.          if (var3 != null) {
  794.             Boolean var4 = (Boolean)this.expandedState.get(var3);
  795.             return var4 != null && var4;
  796.          }
  797.       }
  798.  
  799.       return false;
  800.    }
  801.  
  802.    public boolean isCollapsed(TreePath var1) {
  803.       return !this.isExpanded(var1);
  804.    }
  805.  
  806.    public boolean isCollapsed(int var1) {
  807.       return !this.isExpanded(var1);
  808.    }
  809.  
  810.    public void makeVisible(TreePath var1) {
  811.       if (var1 != null) {
  812.          TreePath var2 = var1.getParentPath();
  813.          if (var2 != null) {
  814.             this.expandPath(var2);
  815.          }
  816.       }
  817.  
  818.    }
  819.  
  820.    public boolean isVisible(TreePath var1) {
  821.       if (var1 != null) {
  822.          TreePath var2 = var1.getParentPath();
  823.          return var2 != null ? this.isExpanded(var2) : true;
  824.       } else {
  825.          return false;
  826.       }
  827.    }
  828.  
  829.    public Rectangle getPathBounds(TreePath var1) {
  830.       TreeUI var2 = this.getUI();
  831.       return var2 != null ? var2.getPathBounds(this, var1) : null;
  832.    }
  833.  
  834.    public Rectangle getRowBounds(int var1) {
  835.       return this.getPathBounds(this.getPathForRow(var1));
  836.    }
  837.  
  838.    public void scrollPathToVisible(TreePath var1) {
  839.       if (var1 != null) {
  840.          this.makeVisible(var1);
  841.          Rectangle var2 = this.getPathBounds(var1);
  842.          if (var2 != null) {
  843.             this.scrollRectToVisible(var2);
  844.             if (this.accessibleContext != null) {
  845.                ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  846.             }
  847.          }
  848.       }
  849.  
  850.    }
  851.  
  852.    public void scrollRowToVisible(int var1) {
  853.       this.scrollPathToVisible(this.getPathForRow(var1));
  854.    }
  855.  
  856.    public TreePath getPathForRow(int var1) {
  857.       TreeUI var2 = this.getUI();
  858.       return var2 != null ? var2.getPathForRow(this, var1) : null;
  859.    }
  860.  
  861.    public int getRowForPath(TreePath var1) {
  862.       TreeUI var2 = this.getUI();
  863.       return var2 != null ? var2.getRowForPath(this, var1) : -1;
  864.    }
  865.  
  866.    public void expandPath(TreePath var1) {
  867.       TreeModel var2 = this.getModel();
  868.       if (var1 != null && var2 != null && !var2.isLeaf(var1.getLastPathComponent())) {
  869.          this.setExpandedState(var1, true);
  870.       }
  871.  
  872.    }
  873.  
  874.    public void expandRow(int var1) {
  875.       this.expandPath(this.getPathForRow(var1));
  876.    }
  877.  
  878.    public void collapsePath(TreePath var1) {
  879.       this.setExpandedState(var1, false);
  880.    }
  881.  
  882.    public void collapseRow(int var1) {
  883.       this.collapsePath(this.getPathForRow(var1));
  884.    }
  885.  
  886.    public TreePath getPathForLocation(int var1, int var2) {
  887.       TreePath var3 = this.getClosestPathForLocation(var1, var2);
  888.       if (var3 != null) {
  889.          Rectangle var4 = this.getPathBounds(var3);
  890.          if (var4 != null && var1 >= var4.x && var1 < var4.x + var4.width && var2 >= var4.y && var2 < var4.y + var4.height) {
  891.             return var3;
  892.          }
  893.       }
  894.  
  895.       return null;
  896.    }
  897.  
  898.    public int getRowForLocation(int var1, int var2) {
  899.       return this.getRowForPath(this.getPathForLocation(var1, var2));
  900.    }
  901.  
  902.    public TreePath getClosestPathForLocation(int var1, int var2) {
  903.       TreeUI var3 = this.getUI();
  904.       return var3 != null ? var3.getClosestPathForLocation(this, var1, var2) : null;
  905.    }
  906.  
  907.    public int getClosestRowForLocation(int var1, int var2) {
  908.       return this.getRowForPath(this.getClosestPathForLocation(var1, var2));
  909.    }
  910.  
  911.    public boolean isEditing() {
  912.       TreeUI var1 = this.getUI();
  913.       return var1 != null ? var1.isEditing(this) : false;
  914.    }
  915.  
  916.    public boolean stopEditing() {
  917.       TreeUI var1 = this.getUI();
  918.       return var1 != null ? var1.stopEditing(this) : false;
  919.    }
  920.  
  921.    public void cancelEditing() {
  922.       TreeUI var1 = this.getUI();
  923.       if (var1 != null) {
  924.          var1.cancelEditing(this);
  925.       }
  926.  
  927.    }
  928.  
  929.    public void startEditingAtPath(TreePath var1) {
  930.       TreeUI var2 = this.getUI();
  931.       if (var2 != null) {
  932.          var2.startEditingAtPath(this, var1);
  933.       }
  934.  
  935.    }
  936.  
  937.    public TreePath getEditingPath() {
  938.       TreeUI var1 = this.getUI();
  939.       return var1 != null ? var1.getEditingPath(this) : null;
  940.    }
  941.  
  942.    public void setSelectionModel(TreeSelectionModel var1) {
  943.       if (var1 == null) {
  944.          var1 = javax.swing.JTree.EmptySelectionModel.sharedInstance();
  945.       }
  946.  
  947.       TreeSelectionModel var2 = this.selectionModel;
  948.       if (this.selectionModel != null && this.selectionRedirector != null) {
  949.          this.selectionModel.removeTreeSelectionListener(this.selectionRedirector);
  950.       }
  951.  
  952.       if (this.accessibleContext != null) {
  953.          this.selectionModel.removeTreeSelectionListener((TreeSelectionListener)this.accessibleContext);
  954.          ((TreeSelectionModel)var1).addTreeSelectionListener((TreeSelectionListener)this.accessibleContext);
  955.       }
  956.  
  957.       this.selectionModel = (TreeSelectionModel)var1;
  958.       if (this.selectionRedirector != null) {
  959.          this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
  960.       }
  961.  
  962.       this.firePropertyChange("selectionModel", var2, this.selectionModel);
  963.       if (this.accessibleContext != null) {
  964.          this.accessibleContext.firePropertyChange("AccessibleSelection", false, true);
  965.       }
  966.  
  967.    }
  968.  
  969.    public TreeSelectionModel getSelectionModel() {
  970.       return this.selectionModel;
  971.    }
  972.  
  973.    protected TreePath[] getPathBetweenRows(int var1, int var2) {
  974.       TreeUI var5 = this.getUI();
  975.       int var3 = Math.min(var1, var2);
  976.       int var4 = Math.max(var1, var2);
  977.       if (var5 == null) {
  978.          return null;
  979.       } else {
  980.          TreePath[] var6 = new TreePath[var4 - var3 + 1];
  981.  
  982.          for(int var7 = var3; var7 <= var4; ++var7) {
  983.             var6[var7 - var3] = var5.getPathForRow(this, var7);
  984.          }
  985.  
  986.          return var6;
  987.       }
  988.    }
  989.  
  990.    public void setSelectionInterval(int var1, int var2) {
  991.       TreePath[] var3 = this.getPathBetweenRows(var1, var2);
  992.       this.getSelectionModel().setSelectionPaths(var3);
  993.    }
  994.  
  995.    public void addSelectionInterval(int var1, int var2) {
  996.       TreePath[] var3 = this.getPathBetweenRows(var1, var2);
  997.       this.getSelectionModel().addSelectionPaths(var3);
  998.    }
  999.  
  1000.    public void removeSelectionInterval(int var1, int var2) {
  1001.       TreePath[] var3 = this.getPathBetweenRows(var1, var2);
  1002.       this.getSelectionModel().removeSelectionPaths(var3);
  1003.    }
  1004.  
  1005.    public void removeSelectionPath(TreePath var1) {
  1006.       this.getSelectionModel().removeSelectionPath(var1);
  1007.    }
  1008.  
  1009.    public void removeSelectionPaths(TreePath[] var1) {
  1010.       this.getSelectionModel().removeSelectionPaths(var1);
  1011.    }
  1012.  
  1013.    public void removeSelectionRow(int var1) {
  1014.       int[] var2 = new int[]{var1};
  1015.       this.removeSelectionRows(var2);
  1016.    }
  1017.  
  1018.    public void removeSelectionRows(int[] var1) {
  1019.       TreeUI var2 = this.getUI();
  1020.       if (var2 != null && var1 != null) {
  1021.          int var3 = var1.length;
  1022.          TreePath[] var4 = new TreePath[var3];
  1023.  
  1024.          for(int var5 = 0; var5 < var3; ++var5) {
  1025.             var4[var5] = var2.getPathForRow(this, var1[var5]);
  1026.          }
  1027.  
  1028.          this.removeSelectionPaths(var4);
  1029.       }
  1030.  
  1031.    }
  1032.  
  1033.    public void clearSelection() {
  1034.       this.getSelectionModel().clearSelection();
  1035.    }
  1036.  
  1037.    public boolean isSelectionEmpty() {
  1038.       return this.getSelectionModel().isSelectionEmpty();
  1039.    }
  1040.  
  1041.    public void addTreeExpansionListener(TreeExpansionListener var1) {
  1042.       if (this.settingUI) {
  1043.          this.uiTreeExpansionListener = var1;
  1044.       }
  1045.  
  1046.       this.listenerList.add(TreeExpansionListener.class, var1);
  1047.    }
  1048.  
  1049.    public void removeTreeExpansionListener(TreeExpansionListener var1) {
  1050.       this.listenerList.remove(TreeExpansionListener.class, var1);
  1051.       if (this.uiTreeExpansionListener == var1) {
  1052.          this.uiTreeExpansionListener = null;
  1053.       }
  1054.  
  1055.    }
  1056.  
  1057.    public TreeExpansionListener[] getTreeExpansionListeners() {
  1058.       return (TreeExpansionListener[])this.listenerList.getListeners(TreeExpansionListener.class);
  1059.    }
  1060.  
  1061.    public void addTreeWillExpandListener(TreeWillExpandListener var1) {
  1062.       this.listenerList.add(TreeWillExpandListener.class, var1);
  1063.    }
  1064.  
  1065.    public void removeTreeWillExpandListener(TreeWillExpandListener var1) {
  1066.       this.listenerList.remove(TreeWillExpandListener.class, var1);
  1067.    }
  1068.  
  1069.    public TreeWillExpandListener[] getTreeWillExpandListeners() {
  1070.       return (TreeWillExpandListener[])this.listenerList.getListeners(TreeWillExpandListener.class);
  1071.    }
  1072.  
  1073.    public void fireTreeExpanded(TreePath var1) {
  1074.       Object[] var2 = this.listenerList.getListenerList();
  1075.       TreeExpansionEvent var3 = null;
  1076.       if (this.uiTreeExpansionListener != null) {
  1077.          var3 = new TreeExpansionEvent(this, var1);
  1078.          this.uiTreeExpansionListener.treeExpanded(var3);
  1079.       }
  1080.  
  1081.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  1082.          if (var2[var4] == TreeExpansionListener.class && var2[var4 + 1] != this.uiTreeExpansionListener) {
  1083.             if (var3 == null) {
  1084.                var3 = new TreeExpansionEvent(this, var1);
  1085.             }
  1086.  
  1087.             ((TreeExpansionListener)var2[var4 + 1]).treeExpanded(var3);
  1088.          }
  1089.       }
  1090.  
  1091.    }
  1092.  
  1093.    public void fireTreeCollapsed(TreePath var1) {
  1094.       Object[] var2 = this.listenerList.getListenerList();
  1095.       TreeExpansionEvent var3 = null;
  1096.       if (this.uiTreeExpansionListener != null) {
  1097.          var3 = new TreeExpansionEvent(this, var1);
  1098.          this.uiTreeExpansionListener.treeCollapsed(var3);
  1099.       }
  1100.  
  1101.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  1102.          if (var2[var4] == TreeExpansionListener.class && var2[var4 + 1] != this.uiTreeExpansionListener) {
  1103.             if (var3 == null) {
  1104.                var3 = new TreeExpansionEvent(this, var1);
  1105.             }
  1106.  
  1107.             ((TreeExpansionListener)var2[var4 + 1]).treeCollapsed(var3);
  1108.          }
  1109.       }
  1110.  
  1111.    }
  1112.  
  1113.    public void fireTreeWillExpand(TreePath var1) throws ExpandVetoException {
  1114.       Object[] var2 = this.listenerList.getListenerList();
  1115.       TreeExpansionEvent var3 = null;
  1116.  
  1117.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  1118.          if (var2[var4] == TreeWillExpandListener.class) {
  1119.             if (var3 == null) {
  1120.                var3 = new TreeExpansionEvent(this, var1);
  1121.             }
  1122.  
  1123.             ((TreeWillExpandListener)var2[var4 + 1]).treeWillExpand(var3);
  1124.          }
  1125.       }
  1126.  
  1127.    }
  1128.  
  1129.    public void fireTreeWillCollapse(TreePath var1) throws ExpandVetoException {
  1130.       Object[] var2 = this.listenerList.getListenerList();
  1131.       TreeExpansionEvent var3 = null;
  1132.  
  1133.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  1134.          if (var2[var4] == TreeWillExpandListener.class) {
  1135.             if (var3 == null) {
  1136.                var3 = new TreeExpansionEvent(this, var1);
  1137.             }
  1138.  
  1139.             ((TreeWillExpandListener)var2[var4 + 1]).treeWillCollapse(var3);
  1140.          }
  1141.       }
  1142.  
  1143.    }
  1144.  
  1145.    public void addTreeSelectionListener(TreeSelectionListener var1) {
  1146.       this.listenerList.add(TreeSelectionListener.class, var1);
  1147.       if (this.listenerList.getListenerCount(TreeSelectionListener.class) != 0 && this.selectionRedirector == null) {
  1148.          this.selectionRedirector = new TreeSelectionRedirector(this);
  1149.          this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
  1150.       }
  1151.  
  1152.    }
  1153.  
  1154.    public void removeTreeSelectionListener(TreeSelectionListener var1) {
  1155.       this.listenerList.remove(TreeSelectionListener.class, var1);
  1156.       if (this.listenerList.getListenerCount(TreeSelectionListener.class) == 0 && this.selectionRedirector != null) {
  1157.          this.selectionModel.removeTreeSelectionListener(this.selectionRedirector);
  1158.          this.selectionRedirector = null;
  1159.       }
  1160.  
  1161.    }
  1162.  
  1163.    public TreeSelectionListener[] getTreeSelectionListeners() {
  1164.       return (TreeSelectionListener[])this.listenerList.getListeners(TreeSelectionListener.class);
  1165.    }
  1166.  
  1167.    protected void fireValueChanged(TreeSelectionEvent var1) {
  1168.       Object[] var2 = this.listenerList.getListenerList();
  1169.  
  1170.       for(int var3 = var2.length - 2; var3 >= 0; var3 -= 2) {
  1171.          if (var2[var3] == TreeSelectionListener.class) {
  1172.             ((TreeSelectionListener)var2[var3 + 1]).valueChanged(var1);
  1173.          }
  1174.       }
  1175.  
  1176.    }
  1177.  
  1178.    public void treeDidChange() {
  1179.       this.revalidate();
  1180.       this.repaint();
  1181.    }
  1182.  
  1183.    public void setVisibleRowCount(int var1) {
  1184.       int var2 = this.visibleRowCount;
  1185.       this.visibleRowCount = var1;
  1186.       this.firePropertyChange("visibleRowCount", var2, this.visibleRowCount);
  1187.       this.invalidate();
  1188.       if (this.accessibleContext != null) {
  1189.          ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  1190.       }
  1191.  
  1192.    }
  1193.  
  1194.    public int getVisibleRowCount() {
  1195.       return this.visibleRowCount;
  1196.    }
  1197.  
  1198.    private void expandRoot() {
  1199.       TreeModel var1 = this.getModel();
  1200.       if (var1 != null && var1.getRoot() != null) {
  1201.          this.expandPath(new TreePath(var1.getRoot()));
  1202.       }
  1203.  
  1204.    }
  1205.  
  1206.    public TreePath getNextMatch(String var1, int var2, Position.Bias var3) {
  1207.       int var4 = this.getRowCount();
  1208.       if (var1 == null) {
  1209.          throw new IllegalArgumentException();
  1210.       } else if (var2 >= 0 && var2 < var4) {
  1211.          var1 = var1.toUpperCase();
  1212.          int var5 = var3 == Bias.Forward ? 1 : -1;
  1213.          int var6 = var2;
  1214.  
  1215.          do {
  1216.             TreePath var7 = this.getPathForRow(var6);
  1217.             String var8 = this.convertValueToText(var7.getLastPathComponent(), this.isRowSelected(var6), this.isExpanded(var6), true, var6, false);
  1218.             if (var8.toUpperCase().startsWith(var1)) {
  1219.                return var7;
  1220.             }
  1221.  
  1222.             var6 = (var6 + var5 + var4) % var4;
  1223.          } while(var6 != var2);
  1224.  
  1225.          return null;
  1226.       } else {
  1227.          throw new IllegalArgumentException();
  1228.       }
  1229.    }
  1230.  
  1231.    private void writeObject(ObjectOutputStream var1) throws IOException {
  1232.       Vector var2 = new Vector();
  1233.       var1.defaultWriteObject();
  1234.       if (this.cellRenderer != null && this.cellRenderer instanceof Serializable) {
  1235.          var2.addElement("cellRenderer");
  1236.          var2.addElement(this.cellRenderer);
  1237.       }
  1238.  
  1239.       if (this.cellEditor != null && this.cellEditor instanceof Serializable) {
  1240.          var2.addElement("cellEditor");
  1241.          var2.addElement(this.cellEditor);
  1242.       }
  1243.  
  1244.       if (this.treeModel != null && this.treeModel instanceof Serializable) {
  1245.          var2.addElement("treeModel");
  1246.          var2.addElement(this.treeModel);
  1247.       }
  1248.  
  1249.       if (this.selectionModel != null && this.selectionModel instanceof Serializable) {
  1250.          var2.addElement("selectionModel");
  1251.          var2.addElement(this.selectionModel);
  1252.       }
  1253.  
  1254.       Object var3 = this.getArchivableExpandedState();
  1255.       if (var3 != null) {
  1256.          var2.addElement("expandedState");
  1257.          var2.addElement(var3);
  1258.       }
  1259.  
  1260.       var1.writeObject(var2);
  1261.       if (this.getUIClassID().equals("TreeUI")) {
  1262.          byte var4 = JComponent.getWriteObjCounter(this);
  1263.          --var4;
  1264.          JComponent.setWriteObjCounter(this, var4);
  1265.          if (var4 == 0 && this.ui != null) {
  1266.             this.ui.installUI(this);
  1267.          }
  1268.       }
  1269.  
  1270.    }
  1271.  
  1272.    private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
  1273.       var1.defaultReadObject();
  1274.       this.expandedState = new Hashtable();
  1275.       this.expandedStack = new Stack();
  1276.       Vector var2 = (Vector)var1.readObject();
  1277.       int var3 = 0;
  1278.       int var4 = var2.size();
  1279.       if (var3 < var4 && var2.elementAt(var3).equals("cellRenderer")) {
  1280.          ++var3;
  1281.          this.cellRenderer = (TreeCellRenderer)var2.elementAt(var3);
  1282.          ++var3;
  1283.       }
  1284.  
  1285.       if (var3 < var4 && var2.elementAt(var3).equals("cellEditor")) {
  1286.          ++var3;
  1287.          this.cellEditor = (TreeCellEditor)var2.elementAt(var3);
  1288.          ++var3;
  1289.       }
  1290.  
  1291.       if (var3 < var4 && var2.elementAt(var3).equals("treeModel")) {
  1292.          ++var3;
  1293.          this.treeModel = (TreeModel)var2.elementAt(var3);
  1294.          ++var3;
  1295.       }
  1296.  
  1297.       if (var3 < var4 && var2.elementAt(var3).equals("selectionModel")) {
  1298.          ++var3;
  1299.          this.selectionModel = (TreeSelectionModel)var2.elementAt(var3);
  1300.          ++var3;
  1301.       }
  1302.  
  1303.       if (var3 < var4 && var2.elementAt(var3).equals("expandedState")) {
  1304.          ++var3;
  1305.          this.unarchiveExpandedState(var2.elementAt(var3));
  1306.          ++var3;
  1307.       }
  1308.  
  1309.       if (this.listenerList.getListenerCount(TreeSelectionListener.class) != 0) {
  1310.          this.selectionRedirector = new TreeSelectionRedirector(this);
  1311.          this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
  1312.       }
  1313.  
  1314.       if (this.treeModel != null) {
  1315.          this.treeModelListener = this.createTreeModelListener();
  1316.          if (this.treeModelListener != null) {
  1317.             this.treeModel.addTreeModelListener(this.treeModelListener);
  1318.          }
  1319.       }
  1320.  
  1321.    }
  1322.  
  1323.    private Object getArchivableExpandedState() {
  1324.       TreeModel var1 = this.getModel();
  1325.       if (var1 != null) {
  1326.          Enumeration var2 = this.expandedState.keys();
  1327.          if (var2 != null) {
  1328.             Vector var3 = new Vector();
  1329.  
  1330.             while(var2.hasMoreElements()) {
  1331.                TreePath var4 = (TreePath)var2.nextElement();
  1332.  
  1333.                int[] var5;
  1334.                try {
  1335.                   var5 = this.getModelIndexsForPath(var4);
  1336.                } catch (Error var7) {
  1337.                   var5 = null;
  1338.                }
  1339.  
  1340.                if (var5 != null) {
  1341.                   var3.addElement(var5);
  1342.                   var3.addElement(this.expandedState.get(var4));
  1343.                }
  1344.             }
  1345.  
  1346.             return var3;
  1347.          }
  1348.       }
  1349.  
  1350.       return null;
  1351.    }
  1352.  
  1353.    private void unarchiveExpandedState(Object var1) {
  1354.       if (var1 instanceof Vector) {
  1355.          Vector var2 = (Vector)var1;
  1356.  
  1357.          for(int var3 = var2.size() - 1; var3 >= 0; --var3) {
  1358.             Boolean var4 = (Boolean)var2.elementAt(var3--);
  1359.  
  1360.             try {
  1361.                TreePath var5 = this.getPathForIndexs((int[])var2.elementAt(var3));
  1362.                if (var5 != null) {
  1363.                   this.expandedState.put(var5, var4);
  1364.                }
  1365.             } catch (Error var7) {
  1366.             }
  1367.          }
  1368.       }
  1369.  
  1370.    }
  1371.  
  1372.    private int[] getModelIndexsForPath(TreePath var1) {
  1373.       if (var1 != null) {
  1374.          TreeModel var2 = this.getModel();
  1375.          int var3 = var1.getPathCount();
  1376.          int[] var4 = new int[var3 - 1];
  1377.          Object var5 = var2.getRoot();
  1378.  
  1379.          for(int var6 = 1; var6 < var3; ++var6) {
  1380.             var4[var6 - 1] = var2.getIndexOfChild(var5, var1.getPathComponent(var6));
  1381.             var5 = var1.getPathComponent(var6);
  1382.             if (var4[var6 - 1] < 0) {
  1383.                return null;
  1384.             }
  1385.          }
  1386.  
  1387.          return var4;
  1388.       } else {
  1389.          return null;
  1390.       }
  1391.    }
  1392.  
  1393.    private TreePath getPathForIndexs(int[] var1) {
  1394.       if (var1 == null) {
  1395.          return null;
  1396.       } else {
  1397.          TreeModel var2 = this.getModel();
  1398.          if (var2 == null) {
  1399.             return null;
  1400.          } else {
  1401.             int var3 = var1.length;
  1402.             Object var4 = var2.getRoot();
  1403.             TreePath var5 = new TreePath(var4);
  1404.  
  1405.             for(int var6 = 0; var6 < var3; ++var6) {
  1406.                var4 = var2.getChild(var4, var1[var6]);
  1407.                if (var4 == null) {
  1408.                   return null;
  1409.                }
  1410.  
  1411.                var5 = var5.pathByAddingChild(var4);
  1412.             }
  1413.  
  1414.             return var5;
  1415.          }
  1416.       }
  1417.    }
  1418.  
  1419.    public Dimension getPreferredScrollableViewportSize() {
  1420.       int var1 = this.getPreferredSize().width;
  1421.       int var2 = this.getVisibleRowCount();
  1422.       int var3 = -1;
  1423.       if (this.isFixedRowHeight()) {
  1424.          var3 = var2 * this.getRowHeight();
  1425.       } else {
  1426.          TreeUI var4 = this.getUI();
  1427.          if (var4 != null && var2 > 0) {
  1428.             int var5 = var4.getRowCount(this);
  1429.             if (var5 >= var2) {
  1430.                Rectangle var6 = this.getRowBounds(var2 - 1);
  1431.                if (var6 != null) {
  1432.                   var3 = var6.y + var6.height;
  1433.                }
  1434.             } else if (var5 > 0) {
  1435.                Rectangle var7 = this.getRowBounds(0);
  1436.                if (var7 != null) {
  1437.                   var3 = var7.height * var2;
  1438.                }
  1439.             }
  1440.          }
  1441.  
  1442.          if (var3 == -1) {
  1443.             var3 = 16 * var2;
  1444.          }
  1445.       }
  1446.  
  1447.       return new Dimension(var1, var3);
  1448.    }
  1449.  
  1450.    public int getScrollableUnitIncrement(Rectangle var1, int var2, int var3) {
  1451.       if (var2 == 1) {
  1452.          int var5 = this.getClosestRowForLocation(0, var1.y);
  1453.          if (var5 != -1) {
  1454.             Rectangle var4 = this.getRowBounds(var5);
  1455.             if (var4.y != var1.y) {
  1456.                if (var3 < 0) {
  1457.                   return Math.max(0, var1.y - var4.y);
  1458.                }
  1459.  
  1460.                return var4.y + var4.height - var1.y;
  1461.             }
  1462.  
  1463.             if (var3 >= 0) {
  1464.                return var4.height;
  1465.             }
  1466.  
  1467.             if (var5 != 0) {
  1468.                var4 = this.getRowBounds(var5 - 1);
  1469.                return var4.height;
  1470.             }
  1471.          }
  1472.  
  1473.          return 0;
  1474.       } else {
  1475.          return 4;
  1476.       }
  1477.    }
  1478.  
  1479.    public int getScrollableBlockIncrement(Rectangle var1, int var2, int var3) {
  1480.       return var2 == 1 ? var1.height : var1.width;
  1481.    }
  1482.  
  1483.    public boolean getScrollableTracksViewportWidth() {
  1484.       if (this.getParent() instanceof JViewport) {
  1485.          return ((JViewport)this.getParent()).getWidth() > this.getPreferredSize().width;
  1486.       } else {
  1487.          return false;
  1488.       }
  1489.    }
  1490.  
  1491.    public boolean getScrollableTracksViewportHeight() {
  1492.       if (this.getParent() instanceof JViewport) {
  1493.          return ((JViewport)this.getParent()).getHeight() > this.getPreferredSize().height;
  1494.       } else {
  1495.          return false;
  1496.       }
  1497.    }
  1498.  
  1499.    protected void setExpandedState(TreePath var1, boolean var2) {
  1500.       if (var1 != null) {
  1501.          TreePath var4 = var1.getParentPath();
  1502.          Stack var3;
  1503.          if (this.expandedStack.size() == 0) {
  1504.             var3 = new Stack();
  1505.          } else {
  1506.             var3 = (Stack)this.expandedStack.pop();
  1507.          }
  1508.  
  1509.          try {
  1510.             label190:
  1511.             while(true) {
  1512.                if (var4 == null) {
  1513.                   int var5 = var3.size() - 1;
  1514.  
  1515.                   while(true) {
  1516.                      if (var5 < 0) {
  1517.                         break label190;
  1518.                      }
  1519.  
  1520.                      var4 = (TreePath)var3.pop();
  1521.                      if (!this.isExpanded(var4)) {
  1522.                         try {
  1523.                            this.fireTreeWillExpand(var4);
  1524.                         } catch (ExpandVetoException var14) {
  1525.                            return;
  1526.                         }
  1527.  
  1528.                         this.expandedState.put(var4, Boolean.TRUE);
  1529.                         this.fireTreeExpanded(var4);
  1530.                         if (this.accessibleContext != null) {
  1531.                            ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  1532.                         }
  1533.                      }
  1534.  
  1535.                      --var5;
  1536.                   }
  1537.                }
  1538.  
  1539.                if (this.isExpanded(var4)) {
  1540.                   var4 = null;
  1541.                } else {
  1542.                   var3.push(var4);
  1543.                   var4 = var4.getParentPath();
  1544.                }
  1545.             }
  1546.          } finally {
  1547.             if (this.expandedStack.size() < TEMP_STACK_SIZE) {
  1548.                var3.removeAllElements();
  1549.                this.expandedStack.push(var3);
  1550.             }
  1551.  
  1552.          }
  1553.  
  1554.          if (!var2) {
  1555.             Object var17 = this.expandedState.get(var1);
  1556.             if (var17 != null && (Boolean)var17) {
  1557.                try {
  1558.                   this.fireTreeWillCollapse(var1);
  1559.                } catch (ExpandVetoException var13) {
  1560.                   return;
  1561.                }
  1562.  
  1563.                this.expandedState.put(var1, Boolean.FALSE);
  1564.                this.fireTreeCollapsed(var1);
  1565.                if (this.removeDescendantSelectedPaths(var1, false) && !this.isPathSelected(var1)) {
  1566.                   this.addSelectionPath(var1);
  1567.                }
  1568.  
  1569.                if (this.accessibleContext != null) {
  1570.                   ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  1571.                }
  1572.             }
  1573.          } else {
  1574.             Object var18 = this.expandedState.get(var1);
  1575.             if (var18 == null || !(Boolean)var18) {
  1576.                try {
  1577.                   this.fireTreeWillExpand(var1);
  1578.                } catch (ExpandVetoException var12) {
  1579.                   return;
  1580.                }
  1581.  
  1582.                this.expandedState.put(var1, Boolean.TRUE);
  1583.                this.fireTreeExpanded(var1);
  1584.                if (this.accessibleContext != null) {
  1585.                   ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
  1586.                }
  1587.             }
  1588.          }
  1589.       }
  1590.  
  1591.    }
  1592.  
  1593.    protected Enumeration<TreePath> getDescendantToggledPaths(TreePath var1) {
  1594.       if (var1 == null) {
  1595.          return null;
  1596.       } else {
  1597.          Vector var2 = new Vector();
  1598.          Enumeration var3 = this.expandedState.keys();
  1599.  
  1600.          while(var3.hasMoreElements()) {
  1601.             TreePath var4 = (TreePath)var3.nextElement();
  1602.             if (var1.isDescendant(var4)) {
  1603.                var2.addElement(var4);
  1604.             }
  1605.          }
  1606.  
  1607.          return var2.elements();
  1608.       }
  1609.    }
  1610.  
  1611.    protected void removeDescendantToggledPaths(Enumeration<TreePath> var1) {
  1612.       if (var1 != null) {
  1613.          while(var1.hasMoreElements()) {
  1614.             Enumeration var2 = this.getDescendantToggledPaths((TreePath)var1.nextElement());
  1615.             if (var2 != null) {
  1616.                while(var2.hasMoreElements()) {
  1617.                   this.expandedState.remove(var2.nextElement());
  1618.                }
  1619.             }
  1620.          }
  1621.       }
  1622.  
  1623.    }
  1624.  
  1625.    protected void clearToggledPaths() {
  1626.       this.expandedState.clear();
  1627.    }
  1628.  
  1629.    protected TreeModelListener createTreeModelListener() {
  1630.       return new TreeModelHandler(this);
  1631.    }
  1632.  
  1633.    protected boolean removeDescendantSelectedPaths(TreePath var1, boolean var2) {
  1634.       TreePath[] var3 = this.getDescendantSelectedPaths(var1, var2);
  1635.       if (var3 != null) {
  1636.          this.getSelectionModel().removeSelectionPaths(var3);
  1637.          return true;
  1638.       } else {
  1639.          return false;
  1640.       }
  1641.    }
  1642.  
  1643.    private TreePath[] getDescendantSelectedPaths(TreePath var1, boolean var2) {
  1644.       TreeSelectionModel var3 = this.getSelectionModel();
  1645.       TreePath[] var4 = var3 != null ? var3.getSelectionPaths() : null;
  1646.       if (var4 == null) {
  1647.          return null;
  1648.       } else {
  1649.          boolean var5 = false;
  1650.  
  1651.          for(int var6 = var4.length - 1; var6 >= 0; --var6) {
  1652.             if (var4[var6] == null || !var1.isDescendant(var4[var6]) || var1.equals(var4[var6]) && !var2) {
  1653.                var4[var6] = null;
  1654.             } else {
  1655.                var5 = true;
  1656.             }
  1657.          }
  1658.  
  1659.          if (!var5) {
  1660.             var4 = null;
  1661.          }
  1662.  
  1663.          return var4;
  1664.       }
  1665.    }
  1666.  
  1667.    void removeDescendantSelectedPaths(TreeModelEvent var1) {
  1668.       TreePath var2 = var1.getTreePath();
  1669.       Object[] var3 = var1.getChildren();
  1670.       TreeSelectionModel var4 = this.getSelectionModel();
  1671.       if (var4 != null && var2 != null && var3 != null && var3.length > 0) {
  1672.          for(int var5 = var3.length - 1; var5 >= 0; --var5) {
  1673.             this.removeDescendantSelectedPaths(var2.pathByAddingChild(var3[var5]), true);
  1674.          }
  1675.       }
  1676.  
  1677.    }
  1678.  
  1679.    void setUIProperty(String var1, Object var2) {
  1680.       if (var1 == "rowHeight") {
  1681.          if (!this.rowHeightSet) {
  1682.             this.setRowHeight(((Number)var2).intValue());
  1683.             this.rowHeightSet = false;
  1684.          }
  1685.       } else if (var1 == "scrollsOnExpand") {
  1686.          if (!this.scrollsOnExpandSet) {
  1687.             this.setScrollsOnExpand((Boolean)var2);
  1688.             this.scrollsOnExpandSet = false;
  1689.          }
  1690.       } else if (var1 == "showsRootHandles") {
  1691.          if (!this.showsRootHandlesSet) {
  1692.             this.setShowsRootHandles((Boolean)var2);
  1693.             this.showsRootHandlesSet = false;
  1694.          }
  1695.       } else {
  1696.          super.setUIProperty(var1, var2);
  1697.       }
  1698.  
  1699.    }
  1700.  
  1701.    protected String paramString() {
  1702.       String var1 = this.rootVisible ? "true" : "false";
  1703.       String var2 = this.showsRootHandles ? "true" : "false";
  1704.       String var3 = this.editable ? "true" : "false";
  1705.       String var4 = this.largeModel ? "true" : "false";
  1706.       String var5 = this.invokesStopCellEditing ? "true" : "false";
  1707.       String var6 = this.scrollsOnExpand ? "true" : "false";
  1708.       return super.paramString() + ",editable=" + var3 + ",invokesStopCellEditing=" + var5 + ",largeModel=" + var4 + ",rootVisible=" + var1 + ",rowHeight=" + this.rowHeight + ",scrollsOnExpand=" + var6 + ",showsRootHandles=" + var2 + ",toggleClickCount=" + this.toggleClickCount + ",visibleRowCount=" + this.visibleRowCount;
  1709.    }
  1710.  
  1711.    public AccessibleContext getAccessibleContext() {
  1712.       if (this.accessibleContext == null) {
  1713.          this.accessibleContext = new AccessibleJTree(this);
  1714.       }
  1715.  
  1716.       return this.accessibleContext;
  1717.    }
  1718.  
  1719.    // $FF: synthetic method
  1720.    static int access$000(JTree var0) {
  1721.       return var0.expandRow;
  1722.    }
  1723.  
  1724.    // $FF: synthetic method
  1725.    static Hashtable access$200(JTree var0) {
  1726.       return var0.expandedState;
  1727.    }
  1728. }
  1729.